home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib15.dsk
/
TEXT FORMATTER (SHORT VERSION).bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
1KB
|
38 lines
10 REM **********************
11 REM * TEXT FORMATTER *
12 REM * SHORT VERSION *
13 REM * BY R. SCOTT SMITH *
14 REM * COPYRIGHT (C) 1983 *
15 REM * BY MICROSPARC, INC *
16 REM * LINCOLN, MA. 01773 *
17 REM **********************
20 REM
30 REM
40 REM MC= MAXIMUM NO. OF COLUMNS OF PRINTER MODE
50 REM NC= NO. OF COLUMNS TO BE PRINTED
60 REM
90 GOTO 1000: REM START OF PROGRAM
100 REM PRINT FORMATTER SUB-ROUTINE
110 IF NC = 0 THEN NC = 40:MC = 40
120 IF MC <NC THEN MC = MC +40: GOTO 120
130 LM = INT((MC -NC)/2) +1
140 IF LEFT$(A$,1) = " " THEN A$ = MID$ (A$,2): GOTO 140
150 IF LEN(A$) < = NC THEN 210
160 Y$ = A$
170 FOR J1 = NC +1 TO 1 STEP -1: IF MID$ (Y$,J1,1) = " " THEN 190
180 NEXT :J1 = NC +1
190 A$ = LEFT$(Y$,J1 -1): GOSUB 210: IF J1 >0 THEN A$ = MID$ (Y$,J1)
200 GOTO 140
210 HTAB LM: PRINT A$;
220 IF LEN(A$) < >MC THEN PRINT
230 A$ = "": RETURN
1000 REM SAMPLE PROGRAM FOR SHORT VERSION OF TEXT FORMATTER
1010 HOME : VTAB 3
1020 A$ = "TEST SHORT VERSION OF TEXT FORMATTER.": GOSUB 100: PRINT
1030 A$ = "MAKE YOUR ENTRY AT LEAST TWO LINES LONG TO SEE HOW THE SHORT VERSION OF TEXT FORMATTER WORKS.": GOSUB 100: PRINT
1040 INPUT "ENTRY: ";Q$
1050 HOME : VTAB 3:A$ = "HERE IS YOUR ENTRY AT FORTY COLUMNS WIDTH.": GOSUB 100: PRINT
1060 A$ = Q$: GOSUB 100: PRINT
1070 INPUT "ENTER ANOTHER PRINT WIDTH: ";NC: PRINT
1080 GOTO 1060
1090 END